
-- Database has: 4 tables.
USE [T2Logging]
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO


/****** Object:  Table [dbo].[Application] Script Date: 2/15/2013 12:00:00 AM ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Application]') AND type in (N'U'))
DROP TABLE [dbo].[Application]
GO




CREATE TABLE [dbo].[Application]
	(
    [ApplicationID] [Int] Identity(1,1) NOT NULL, 
    				[ApplicationName] [NVarChar](100) NOT NULL,
				[TS] [TimeStamp],
				[CreatedBy] [VarChar](50) NOT NULL,
				[CreatedDt] [DateTime],
				[ModifiedBy] [VarChar](50) NOT NULL,
				[ModifiedDt] [DateTime],
				[TenantID] [Int],
CONSTRAINT [PK_Application] PRIMARY KEY CLUSTERED (
[ApplicationID] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
)  ON [PRIMARY]
		
GO



/****** Object:  Table [dbo].[LogCategory] Script Date: 2/15/2013 12:00:00 AM ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LogCategory]') AND type in (N'U'))
DROP TABLE [dbo].[LogCategory]
GO




CREATE TABLE [dbo].[LogCategory]
	(
    [LogCategoryID] [Int] Identity(1,1) NOT NULL, 
    				[LogCategoryName] [NVarChar](50) NOT NULL,
				[TS] [TimeStamp],
				[CreatedBy] [VarChar](50) NOT NULL,
				[CreatedDt] [DateTime],
				[ModifiedBy] [VarChar](50) NOT NULL,
				[ModifiedDt] [DateTime],
CONSTRAINT [PK_LogCategory] PRIMARY KEY CLUSTERED (
[LogCategoryID] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
)  ON [PRIMARY]
		
GO



/****** Object:  Table [dbo].[Log] Script Date: 2/15/2013 12:00:00 AM ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Log]') AND type in (N'U'))
DROP TABLE [dbo].[Log]
GO




CREATE TABLE [dbo].[Log]
	(
    [LogID] [Int] Identity(1,1) NOT NULL, 
    				[Priority] [Int],
				[Severity] [NVarChar](32) NOT NULL,
				[Title] [NVarChar](256) NOT NULL,
				[MachineName] [NVarChar](32) NOT NULL,
				[AppDomainName] [NVarChar](512) NOT NULL,
				[Message] [NVarChar](2000) NOT NULL,
				[TS] [TimeStamp],
				[CreatedBy] [VarChar](50) NOT NULL,
				[CreatedDt] [DateTime],
				[ModifiedBy] [VarChar](50) NOT NULL,
				[ModifiedDt] [DateTime],
				[ApplicationID] [Int],
				[LogCategoryID] [Int],
CONSTRAINT [PK_Log] PRIMARY KEY CLUSTERED (
[LogID] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
)  ON [PRIMARY]
		
GO



/****** Object:  Table [dbo].[Tenant] Script Date: 2/15/2013 12:00:00 AM ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Tenant]') AND type in (N'U'))
DROP TABLE [dbo].[Tenant]
GO




CREATE TABLE [dbo].[Tenant]
	(
    [TenantID] [Int] Identity(1,1) NOT NULL, 
    				[TenantName] [NVarChar](250) NOT NULL,
				[TS] [TimeStamp],
				[CreatedBy] [VarChar](50) NOT NULL,
				[CreatedDt] [DateTime],
				[ModifiedBy] [VarChar](50) NOT NULL,
				[ModifiedDt] [DateTime],
CONSTRAINT [PK_Tenant] PRIMARY KEY CLUSTERED (
[TenantID] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
)  ON [PRIMARY]
		
GO

  
SET ANSI_PADDING OFF
GO  

